import { createRouter, createWebHashHistory } from 'vue-router'

import LoginView from '../views/login.vue'
import Register from '../views/Register'
import Home from '../views/Home'
import Article from "@/components/Article";
import Book from "@/components/Book";
import News from "@/components/News";
import HomeAside from "@/components/HomeAside";
import ContainerPage from "@/components/containerPage";
const routes = [
  {
    path: '/',
    redirect: '/login'
  },
  {
    path: '/login',
    component: LoginView
  },
  {
    path: '/register',
    component: Register
  },
  {
    path: '/home',
    component: Home,
    redirect: '/containerPage',
    children :[
      { path: '/containerPage', component: ContainerPage},
      { path: '/bookPage', component: Book },
      { path: '/articlePage', component: Article },
      { path: '/newsPage', component: News }
    ]
  },

  { path: '/asidePage', component: HomeAside},

]

const router = createRouter({
  mode: 'history',
  history: createWebHashHistory(),
  routes
})

export default router
